<template>
  <div class="gallery" @click="gallery" v-if="this.$store.state.gallery">
    <div class="wrapper">
      <swiper :options="swiperOption">
        <!-- slides -->
        <swiper-slide v-for="item in list" :key="item.id">
          <img :src="item.url">
        </swiper-slide>
        <div class="swiper-pagination" slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Gallery',
  props: {
    list: Array
  },
  data () {
    return {
      swiperOption: {
        pagination: {
          el: '.swiper-pagination',
          type: 'fraction'
        }
      }
    }
  },
  methods: {
    gallery () {
      // console.log('55')
      let blick = false
      this.$store.dispatch('isture', blick)
    }
  }
}
</script>

<style lang="stylus" scoped="scoped">
  .gallery
   position absolute
   top 0rem
   left 0rem
   right 0rem
   bottom 0rem
   background #000000
   display flex
   flex-direction column
   justify-content center
   z-index 99
   .wrapper
    width 100%
    img
     width 100%
   .wrapper >>> .swiper-container
    overflow inherit
   .wrapper >>> .swiper-pagination
    color #FFFFFF
   .wrapper >>> .swiper-pagination-fraction
    bottom -2.2rem
</style>
